import urllib.request


# 定制请求对象
url = 'xxxx'
header = {
    'key1': 'val1',
    'key2': 'val2',
    'key3': 'val3',
    # ....
}

request = urllib.request.Request(url=url, headers=header)
response = urllib.request.urlopen(request)
html = response.read().decode('UTF-8')
print(html)

